$(function(){
	var form = $("#form-change-password");
	form.submit(function(){
		var password = $("#password").val();
		var password_confirm = $("#password-confirm").val();
		if(password != password_confirm){
			$(".form-password-confirm .form-message").text("两次密码不一致！");
			return false;
		}
		if(password.length > 10 || password.length <6){
			$(".form-password .form-message").text("长度请保持在6到10之间！");
			return false;
		}
        $.ajax({
            type : 'POST',
            url : 'editPwd',
            data :{
                password:$("#password-confirm").val()
            },
            success: function (data) {
                alert("修改成功!请重新登陆！")
                window.location.href='login.html';
            }
		});
		return false;
	});
});